﻿using System;
using System.Reflection;
using Microsoft.Office.Project.EPMAuditing.Library;
using Microsoft.Office.Project.Server.Events;
using Microsoft.Office.Project.Server.Library;

namespace Microsoft.Office.Project.EPMAuditing.EventHandlers
{
    public class NotificationsEvents : NotificationsEventReceiver
    {
        public override void OnSending(PSContextInfo contextInfo, NotificationsPreSendEventArgs e)
        {
            AuditEvent ae = new AuditEvent(DateTime.Now, MethodBase.GetCurrentMethod().ReflectedType.Name, MethodBase.GetCurrentMethod().Name, contextInfo, e);
            ae.Post();
        }

        public override void OnSent(PSContextInfo contextInfo, NotificationsPostSendEventArgs e)
        {
            AuditEvent ae = new AuditEvent(DateTime.Now, MethodBase.GetCurrentMethod().ReflectedType.Name, MethodBase.GetCurrentMethod().Name, contextInfo, e);
            ae.Post();
        }
    }
}
